From: Andres Lagar-Cavilla Date: Tue, 6 Dec 2011 20:10:32 +0000 (+0000) Subject: x86/mm: Allow dummy responses on the mem_event ring. X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=4803908397f076691052684a3b42fcf2d4109420;p=xen.git x86/mm: Allow dummy responses on the mem_event ring. Ring semantics require that for every request, a response be put. This allows consumer to place a dummy response if need be. Signed-off-by: Andres Lagar-Cavilla Signed-off-by: Tim Deegan Committed-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 6c42a78bd2..6251f6561c 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -303,6 +303,8 @@ int mem_sharing_sharing_resume(struct domain *d) /* Get all requests off the ring */ while ( mem_event_get_response(&d->mem_event->share, &rsp) ) { + if ( rsp.flags & MEM_EVENT_FLAG_DUMMY ) + continue; /* Unpause domain/vcpu */ if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) vcpu_unpause(d->vcpu[rsp.vcpu_id]); diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index a5113ded60..7363282179 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -1056,6 +1056,8 @@ void p2m_mem_paging_resume(struct domain *d) /* Pull all responses off the ring */ while( mem_event_get_response(&d->mem_event->paging, &rsp) ) { + if ( rsp.flags & MEM_EVENT_FLAG_DUMMY ) + continue; /* Fix p2m entry if the page was not dropped */ if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) ) { @@ -1164,6 +1166,8 @@ void p2m_mem_access_resume(struct domain *d) /* Pull all responses off the ring */ while( mem_event_get_response(&d->mem_event->access, &rsp) ) { + if ( rsp.flags & MEM_EVENT_FLAG_DUMMY ) + continue; /* Unpause domain */ if ( rsp.flags & MEM_EVENT_FLAG_VCPU_PAUSED ) vcpu_unpause(d->vcpu[rsp.vcpu_id]); diff --git a/xen/include/public/mem_event.h b/xen/include/public/mem_event.h index 0b91a76341..770cc7cb9a 100644 --- a/xen/include/public/mem_event.h +++ b/xen/include/public/mem_event.h @@ -40,6 +40,7 @@ #define MEM_EVENT_FLAG_DROP_PAGE (1 << 1) #define MEM_EVENT_FLAG_EVICT_FAIL (1 << 2) #define MEM_EVENT_FLAG_FOREIGN (1 << 3) +#define MEM_EVENT_FLAG_DUMMY (1 << 4) /* Reasons for the memory event request */ #define MEM_EVENT_REASON_UNKNOWN 0 /* typical reason */